From f2f6c65ff6feaa2a7b59e91111e6ca1870344843 Mon Sep 17 00:00:00 2001 From: "tsteven4@gmail.com" Date: Sun, 5 Jan 2014 01:38:33 +0000 Subject: [PATCH] leak fixes for shape, ggv_ovl, nmea. and a bit of NEW_STRINGS cleanup. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4710 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/exif.cc | 7 ------- gpsbabel/ggv_ovl.cc | 2 +- gpsbabel/nmea.cc | 9 +-------- gpsbabel/shape.cc | 2 +- gpsbabel/xcsv.cc | 7 ------- 5 files changed, 3 insertions(+), 24 deletions(-) diff --git a/gpsbabel/exif.cc b/gpsbabel/exif.cc index 6c9f9396e..7f92bcf4f 100644 --- a/gpsbabel/exif.cc +++ b/gpsbabel/exif.cc @@ -892,14 +892,7 @@ exif_waypt_from_exif_app(exif_app_t* app) if (((c = strchr(cx, '.'))) && (c != cx)) { *c = '\0'; } -#if NEW_STRINGS wpt->shortname = cx; -#else - if (wpt->shortname) { - xfree(wpt->shortname); - } - wpt->shortname = xstrdup(cx); -#endif xfree(str); } diff --git a/gpsbabel/ggv_ovl.cc b/gpsbabel/ggv_ovl.cc index 9ef4e1ca3..cd68c551e 100644 --- a/gpsbabel/ggv_ovl.cc +++ b/gpsbabel/ggv_ovl.cc @@ -175,7 +175,7 @@ ggv_ovl_read(void) case OVL_SYMBOL_TRIANGLE: wpt = waypt_new(); - wpt->shortname = xstrdup(symbol); + wpt->shortname = symbol; if ((cx = inifile_readstr(inifile, symbol, "YKoord"))) { wpt->latitude = atof(cx); diff --git a/gpsbabel/nmea.cc b/gpsbabel/nmea.cc index ffd0e4cc7..0ed98b044 100644 --- a/gpsbabel/nmea.cc +++ b/gpsbabel/nmea.cc @@ -287,14 +287,7 @@ nmea_rd_init(const char* fname) if (!wpt) { return; } -#if NEW_STRINGS wpt->shortname = "Position"; -#else - if (wpt->shortname) { - xfree(wpt->shortname); - } - wpt->shortname = xstrdup("Position"); -#endif nmea_add_wpt(wpt, NULL); return; } @@ -646,7 +639,7 @@ gpwpl_parse(char* ibuf) } waypt->longitude = ddmm2degrees(lngdeg); - waypt->shortname = xstrdup(sname); + waypt->shortname = sname; curr_waypt = NULL; /* waypoints won't be updated with GPS fixes */ nmea_add_wpt(waypt, NULL); diff --git a/gpsbabel/shape.cc b/gpsbabel/shape.cc index 8aa9ba58e..8f7f6c6f4 100644 --- a/gpsbabel/shape.cc +++ b/gpsbabel/shape.cc @@ -185,7 +185,7 @@ my_read(void) wpt = waypt_new(); wpt->latitude = shp->dfYMin; wpt->longitude = shp->dfXMin; - wpt->shortname = xstrdup(name); + wpt->shortname = name; if (url) { wpt->AddUrlLink(url); } diff --git a/gpsbabel/xcsv.cc b/gpsbabel/xcsv.cc index 76b33e5cf..cfbc84ac0 100644 --- a/gpsbabel/xcsv.cc +++ b/gpsbabel/xcsv.cc @@ -704,14 +704,7 @@ xcsv_wr_position(waypoint* wpt) /* Tweak incoming name if we don't have a fix */ switch (wpt->fix) { case fix_none: -#if NEW_STRINGS wpt->shortname = "ESTIMATED Position"; -#else - if (wpt->shortname) { - xfree(wpt->shortname); - } - wpt->shortname = xstrdup("ESTIMATED Position"); -#endif break; default: break; -- 2.30.2